package com.common.base;

import com.github.pagehelper.PageInfo;
import com.common.entity.PageParam;
import com.common.entity.Rsp;

import java.util.List;

public interface BaseService<T> {

    //高级检索
    PageInfo<T> searchSomeByPage(PageParam<T> pageParam);

    //根据id查询
    T getOneById(String id);

    //添加
    Rsp addOne(T t);

    //修改
    Rsp update(T t);

    //逻辑删除
    Rsp deleteLogical(T t);

    //物理删除
    default Rsp deleteOneTrue(String id) {
        return null;
    }

    default Rsp recoverLogical(T t) {
        return null;
    }

    default Rsp deleteBatchTrue(List<String> ids) {
        return null;
    }

    default Rsp deleteBatchLogical(List<String> ids) {
        return null;
    }

    default Rsp deleteSomeLogicalByCondition(T t) {
        return null;
    }

    default Rsp deleteSomeTrueByCondition(T t) {
        return null;
    }

}
